//
//  LLFileManagerTool.swift
//  新印象
//
//  Created by wyl on 2016/12/27.
//  Copyright © 2016年 魏延龙. All rights reserved.
//

import UIKit

let pathFile = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first!
class LLFileManagerTool: NSObject {
    
    static let sharemanager = LLFileManagerTool()
    
    func creatFile(path : String?) -> String{
        var path = path
        path = pathFile.appending("/\(path)")
        do {
            try FileManager.default.createDirectory(atPath: path!, withIntermediateDirectories: true, attributes: nil)
        } catch  {
            print("新建文件夹失败")
        }
        return path!
        
    }
    
    func queryFile(path : String) -> Array<String>{
        var path = path
        path = pathFile.appending("/\(path)")
        print("path : ", path, FileManager.default.subpaths(atPath: path)!)
        return FileManager.default.subpaths(atPath: path)!
    }
    

}
